gtk-reftest: Clarify --direction argument parameters
authorBenjamin Otte <otte@redhat.com>
Sat, 31 May 2014 02:52:53 +0000 (04:52 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 31 May 2014 03:19:41 +0000 (05:19 +0200)
... and print a proper error message when the parameter is not
recognized.

testsuite/reftests/gtk-reftest.c

index 70808f11ab34683a978319e80977b099c4cd444c..0e30d7cdc24edc54773fb6aafcdaaa6fbb561b0f 100644 (file)
@@ -44,7 +44,7 @@ static const GOptionEntry test_args[] = {
   { "directory",        'd', 0, G_OPTION_ARG_FILENAME, &arg_base_dir,
     "Directory to run tests from", "DIR" },
   { "direction",       0, 0, G_OPTION_ARG_STRING, &arg_direction,
-    "Set text direction", "DIRECTION" },
+    "Set text direction", "ltr|rtl" },
   { NULL }
 };
 
@@ -70,6 +70,8 @@ parse_command_line (int *argc, char ***argv)
     gtk_widget_set_default_direction (GTK_TEXT_DIR_RTL);
   else if (g_strcmp0 (arg_direction, "ltr") == 0)
     gtk_widget_set_default_direction (GTK_TEXT_DIR_LTR);
+  else
+    g_printerr ("Invalid argument passed to --direction argument. Valid arguments are 'ltr' and 'rtl'\n");
 
   return TRUE;
 }